<template>
	<view class="work-container">
		<!-- 轮播图 -->
		<view>
			<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
				<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
					<swiper-item v-for="(item, index) in lb" :key="index">
						<view class="swiper-item" @click="clickBannerItem(item)">
							<image :src="item.carouselCover" mode="aspectFill" :draggable="false" />
						</view>
					</swiper-item>
				</swiper>
			</uni-swiper-dot>
		</view>


		<!-- 宫格组件 -->
		<view class="zx_main">
			<u-grid :border="false" @click="click">
				<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex">
					<image class="zx_img" :src="baseListItem.url"></image>
				</u-grid-item>
			</u-grid>
		</view>

		<view>
			<image style="width: 100%;height: 222rpx;position: fixed;left: 0;bottom: 0;"
				src="https://img.wilmer.com.cn/bank/bt.png"></image>
		</view>



	</view>
</template>

<script>
	import {
		listCarousel
	} from '@/api/system/bank_request.js'
	
	export default {
		data() {
			return {
				//弹窗
				pop:null,
				current: 0,
				swiperDotIndex: 0,
				lb: [],
				data: [{
						image: 'https://img.wilmer.com.cn/bank/lb1.png'
					},
					{
						image: 'https://img.wilmer.com.cn/bank/lb2.png'
					},
					{
						image: 'https://img.wilmer.com.cn/bank/lb1.png'
					}
				],
				baseList: [{
						url: 'https://img.wilmer.com.cn/bank/kzx.png',
					},
					{
						url: 'https://img.wilmer.com.cn/bank/yh.png',
					},
					{
						url: 'https://img.wilmer.com.cn/bank/gw.png',
					},
					
				]
			}
		},
		onLoad() {
			this.getlb()
			this.getpop()
		},
		methods: {
			
			getpop(){
				this.getConfigKey("pop").then(response => {
				  this.pop = response.msg;
				});
			},
			getlb() {
				listCarousel().then(res => {
					this.lb = res.rows
				})
			},
			clickBannerItem(item) {
				console.info(item)
			},
			click(name) {
				switch (name) {
					case 0:
						this.$tab.navigateTo(`/pages/business/index?type=查征信`)
						break;
					case 1:
						this.$tab.navigateTo(`/pages/business/index?type=养征信`)
						break;
					case 2:
						this.$tab.navigateTo(`/pages/advisor/advisor`)
						break;
					default:
						this.$modal.showToast('模块建设中~')
				}
			},
			changeSwiper(e) {
				this.current = e.detail.current
			},
			changeGrid(e) {
				this.$modal.showToast('模块建设中~')
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */
	.zx_main {
		margin-top: 140rpx;

	}

	.text {
		text-align: center;
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.zx_img {
		width: 164rpx;
		height: 196rpx;
	}

	.grid-item-box {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
		;
	}

	.swiper {
		height: 448rpx;
	}

	.swiper-box {
		height: 448rpx;
	}

	.swiper-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #fff;
		height: 448rpx;
		line-height: 448rpx;
	}

	@media screen and (min-width: 500px) {
		.uni-swiper-dot-box {
			width: 400px;
			/* #ifndef APP-NVUE */
			margin: 0 auto;
			/* #endif */
			margin-top: 8px;
		}

		.image {
			width: 100%;
		}
	}
</style>